import React,{Component} from 'react'
import {BrowserRouter as Router,Route} from 'react-router-dom'
import Loadable from 'react-loadable';
import Loading from '../components/Loading';


const HelpDoc = Loadable({
  loader: () => import('../containers/help'),
  loading: Loading
})
const Module =Loadable({
  loader:()=>import('../containers/help/module'),
  loading:Loading
})
const Document =Loadable({
  loader:()=>import('../containers/help/document'),
  loading:Loading
})
const Edit =Loadable({
  loader:()=>import('../containers/edit'),
  loading:Loading
}) 
const LoginForm=Loadable({
  loader:()=>import('../containers/login'),
  loading:Loading
})


class Routers extends Component{
  render()
  {
    return (<Router>
              <div>
                <Route exact path="/" component={HelpDoc}/>
                <Route exact path="/employee" component={Module}/>
                <Route exact path="/analysis" component={Module}/>
                <Route exact path="/attendance" component={Module}/>
                <Route exact path="/insurance" component={Module}/>
                <Route exact path="/process" component={Module}/>
                <Route exact path="/salary" component={Module}/>
                <Route exact path="/setting" component={Module}/>
                <Route exact path="/admin/werenshi/postedit" component={Edit}/>
                <Route exact path="/admin/werenshi/postedit/:id" component={Edit}/>
                <Route exact path="/:module/:question" component={Document}/>
                <Route exact path="/login" component={LoginForm} />
              </div>
          </Router>);
  }
}
export default Routers;